//函数防抖
export default function debounce(fn, duration) {
    let timeId = null;
    return (...args) => {
        clearTimeout(timeId);
        timeId = setTimeout(() => {
            fn(...args)
        }, duration)
    }
}